﻿@{
    Layout = null;
}
@model ElingOA6_Admin_DSJCJ.Areas.Admin.Models.DocumentClsViewModel
@{
    int documentCount = ViewData["documentCount"] == null ? 0 : int.Parse(ViewData["documentCount"].ToString());//相关类别的信息条数
}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>信息类别编辑</title>
    @Html.Partial("LoadPanelPartial")
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
        <script src="../../../../Scripts/json2.js" type="text/javascript"></script>  
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery-ui-tabs.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/CJL.0.1.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/ImagePreview.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

    new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
    )
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
    )

    <script>
     var documentCount=@documentCount;

    </script>

    <style type="text/css">
        .tdNoBorder
        {
            border-left: 0px;
            border-bottom: 0px;
        }
        .sywzClass
        {
            background-color: Red;
        }
    </style>

    <script>
        $(document).ready(function () {
            $("#tabs").css("display", "block");
            $("#tabs").tabs();
            $("#toolMenu").smartFloat();
            $('#imgTemplTopPicPath').css("height", "100px");
            $('#imgTemplTopPicPath').css("width", "200px");
            $('#imgLogo').css("height", "100px");
            $('#imgLogo').css("width", "100px");
            //var clienttabCtlGroupObj = ASPxClientPageControl.Cast("tabCtlGroup");
            //clienttabCtlGroupObj.SetClientVisible(true);
            //水印位置代码
            $('#tbSYWZ :button').click(function () {
                $('.sywzClass').removeClass("sywzClass");
                $(this).addClass("sywzClass");
                var waterMarkPos = $(this).attr('id').replace("water", "");
                $('#hidWaterMarkPos').val(waterMarkPos); //把水印位置保存到隐藏域
            });
            //加载时判断水印是否已选择
            if ($('#hidWaterMarkPos').val() != "") {
                var buttonid = "water" + $('#hidWaterMarkPos').val();
                $('#' + buttonid).addClass("sywzClass");
            }
            if ($("#hdMethod").val() != "EDIT") {
                var clientFDocClsCObj = ASPxClientTextBox.Cast("FDocClsCd");
                $(clientFDocClsCObj.GetInputElement()).blur(function () {
                    var docClsCd = $(this).val();
                    $.ajax({
                        type: "GET",
                        url: rootPath + "/Admin/DocumentCls/IsExistsDocClsCd",
                        data: { docClsCd: docClsCd },
                        success: function (result) {
                            if (result == "1") {
                                alert("类别编号已存在，请重新填写!");
                                clientFDocClsCObj.SetText("");
                            }
                        }
                    });
                });
            }
            //绑定权限
            addRowBm_table('Pub');
            addRowBm_table('Manage');
            addRowBm_table('Audit');
            addRowBm_table('Look');

            addRowGZZ_table('Pub');
            addRowGZZ_table('Manage');
            addRowGZZ_table('Audit');
            addRowGZZ_table('Look');

            addRowGW_table('Pub');
            addRowGW_table('Manage');
            addRowGW_table('Audit');
            addRowGW_table('Look');

            addGroup('Pub');
            addGroup('Manage');
            addGroup('Audit');
            addGroup('Look');

            addUser('Pub');
            addUser('Manage');
            addUser('Audit');
            addUser('Look');


            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
            }
        });
        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnSave":
                    {
                        //保存
                        save()
                        break;
                    }
                case "btnAddSame":
                    {
                        //增加同级
                        addSame();
                        break;
                    }
                case "btnAddNext":
                    {
                        //增加下级
                        addNext();
                        break;
                    }
                case "btnDelete":
                    {
                        //删除
                        deleteDocCls();
                        break;
                    }
                case "btnSeqSameLevel":
                    {
                        //同级栏目排序
                        seqSameLevel();
                        break;
                    }
            }
        }
        /*增加同级*/
        function addSame() {
            var actionOP = 'ADD_SAME';
            var docClsCd = FDocClsCd.GetText();
            window.location.href = rootPath + "/Admin/DocumentCls/DocumentClsEdit?docClsCd=" + docClsCd + "&actionOP=" + actionOP;
        }
        /*增加下级*/
        function addNext() {
            var actionOP = 'ADD_NEXT';
            var docClsCd = FDocClsCd.GetText();
            window.location.href = rootPath + "/Admin/DocumentCls/DocumentClsEdit?docClsCd=" + docClsCd + "&actionOP=" + actionOP;
        }
        /*删除信息类别*/
        function deleteDocCls() {
            var docClsCd = ASPxClientTextBox.Cast("FDocClsCd").GetText();
            var docClsName = ASPxClientTextBox.Cast("FDocClsName").GetText();
            var docClsProp = ASPxClientComboBox.Cast("FDocClsProp").GetValue();
            if (confirm("确定删除【" + docClsName + "】吗？")) {
                if (docClsProp == "2") {
                    //单信息
                    if (!confirm("该信息为单信息,删除的同时会删除相应的数据,是否删除?")) {
                        return;
                    }
                }
                lpModal.Show();
                $.ajax({
                    type: "POST",
                    url: rootPath + "/Admin/DocumentCls/DeleteDocumentCls",
                    data: { docClsCd: docClsCd },
                    success: function (result) {
                        var msg = result.split('|');
                        if (msg[0] == "SUCCESS") {
                            alert("删除成功");
                            parent.afterDeleteNode();
                        }
                        else {
                            if (msg.length > 1) {
                                alert(msg[1]);
                            }
                        }
                    }
                });
            }
        }
        /*同级栏目排序*/
        function seqSameLevel() {
            var docClsCd = FDocClsCd.GetText();
            var url = rootPath + "/Admin/DocumentCls/DocumentClsSeq?docClsCd=" + docClsCd;
            var returnValue = window.showModalDialog(url, 'docclstopseq', 'dialogWidth:700px;dialogHeight:500px');
            if (typeof (returnValue) != "undefined") {
                if (returnValue == "SUCCESS") {
                    var keyFocuse = rootPath + "/Admin/DocumentCls/DocumentClsEdit|" + docClsCd;
                    parent.refreshLevelNode(keyFocuse);
                }

            }

        }
        /*栏目类型改变*/
        function FDocClsProp_ValueChanged(s, e) {
            if ($("#hdMethod").val() == "EDIT") {
                //修改状态下
                var prop = $("#hdDocClsProp").val();
                var docCount = documentCount;
                if (prop == 0 || docCount == 0 || prop == 9) {

                }
                else {
                    var selectProp = ASPxClientComboBox.Cast(s).GetValue();
                    if (prop == 1) //多信息
                    {
                        if (selectProp == 2 && docCount > 1)//改成单信息，且信息条数大于1
                        {
                            alert("该类别下的信息条数大于1条,不能改成单信息!");
                            ASPxClientComboBox.Cast(s).SetValue(prop);
                        } else if (selectProp == 9 && docCount > 0)//改成无信息，且信息条数大于0 
                        {
                            alert("该类别下的信息条数大于等于1条,不能改成无信息!");
                            ASPxClientComboBox.Cast(s).SetValue(prop);
                        }
                    } else if (prop == 2) //单信息
                    {
                        if (selectProp == 9 && docCount > 0) //改成无信息,且信息条数大于0
                        {
                            alert("该类别下的信息条数大于等于1条,不能改成无信息!");
                            ASPxClientComboBox.Cast(s).SetValue(prop);
                        }
                    }
                }
            }
        }
        function editMode_ValueChanged(s, e) {
            var clientFEditModeObj = ASPxClientComboBox.Cast(s);
            var clientFDefaultEditModeObj = ASPxClientComboBox.Cast("FDefaultEditMode");
            if (clientFEditModeObj.GetValue() != "A") {
                clientFDefaultEditModeObj.SetValue(clientFEditModeObj.GetValue());
                clientFDefaultEditModeObj.SetEnabled(false);
            }
            else {
                clientFDefaultEditModeObj.SetValue("H");
                clientFDefaultEditModeObj.SetEnabled(true);

            }

        }
        function isShowHomePageCtrl_CheckedChanged(s, e) {
            var clientFIsShowHomePageCtrlObj = ASPxClientCheckBox.Cast(s);
            var clientFDefaultShowValueObj = ASPxClientComboBox.Cast("FDefaultShowValue");
            if (clientFIsShowHomePageCtrlObj.GetChecked() == true) {
                clientFDefaultShowValueObj.SetEnabled(true);
            }
            else {
                clientFDefaultShowValueObj.SetEnabled(false);
                clientFDefaultShowValueObj.SetSelectedIndex(1);
            }

        }
        function isHomePageShowLimit_CheckedChanged(source, e) {
            if (FIsHomePageShowLimit.GetChecked()) {
                FHomePageShowDays.SetEnabled(true);
            }
            else {
                FHomePageShowDays.SetEnabled(false);
            }
        }
        /*信息审核权限*/
        function isNeedAudit_CheckedChanged(source, e) {
            //var clienttabCtlGroupObj = ASPxClientPageControl.Cast("tabCtlGroup");
            //clienttabCtlGroupObj.GetTab(2).SetEnabled(FIsNeedAudit.GetChecked());
            if (FIsNeedAudit.GetChecked()) {
                $("#liAuditTab").css("display", "block");
            }
            else {
                $("#liAuditTab").css("display", "none");
            }
        }
        /*控制查看权限初始化*/
        function isCtrlLookAuthority_Init(source, e) {
            if (FIsCtrlLookAuthority.GetChecked()) {
                FLookAuthorityMode.SetEnabled(true);
                $("#liLookTab").css("display", "block");
            }
            else {
                FLookAuthorityMode.SetEnabled(false);
                $("#liLookTab").css("display", "none");
            }
        }
        /*控制查看权限*/
        function isCtrlLookAuthority_CheckedChanged(source, e) {
            //var clienttabCtlGroupObj = ASPxClientPageControl.Cast("tabCtlGroup");
            //clienttabCtlGroupObj.GetTab(3).SetEnabled(FIsCtrlLookAuthority.GetChecked());

            //var a = ASPxClientComboBox.Cast("");
            //a.SetSelectedItem(a.FindItemByValue("toCls"));
            if (FIsCtrlLookAuthority.GetChecked()) {
                FIsPublicTitle.SetChecked(true);
                FIsPublicTitle.SetEnabled(true);

                FLookAuthorityMode.SetEnabled(true);
                FLookAuthorityMode.SetSelectedItem(FLookAuthorityMode.FindItemByValue("A"));
                $("#liLookTab").css("display", "block");
                
            }
            else {
                FIsPublicTitle.SetChecked(false);
                FIsPublicTitle.SetEnabled(false);

                FLookAuthorityMode.SetEnabled(false);
                FLookAuthorityMode.SetSelectedItem(FLookAuthorityMode.FindItemByValue("A"));
                $("#liLookTab").css("display", "none");

                var docClsCd=FDocClsCd.GetText()
                $.ajax({
                    type: "POST",
                    url: rootPath + "/Admin/DocumentCls/ExistDocAuthority",
                    data: { docClsCd: docClsCd },
                    success: function (result) {
                        if (result == "Exist") {
                            if (confirm("此栏目的信息存在控制到信息的查看权限，是否清除这些查看权限？")) {
                                ClearDocumentAuthority(docClsCd);
                            }
                        }
                        else if (result == "NotExist") {
                        }
                        else {
                            alert("程序错误,错误为：" + result);
                        }
                    }
                });
            }
        }
        /*清除权限*/
        function ClearDocumentAuthority(docClsCd) {
            $.ajax({
                type: "POST",
                url: rootPath + "/Admin/DocumentCls/ClearDocumentAuthority",
                data: { docClsCd: docClsCd },
                success: function (result) {
                    if (result == "SUCCESS") {
                        alert("信息查看权限清除成功！");
                    }
                    else {
                        alert("程序错误,错误为：" + result);
                    }
                }
            });
        }

        /*查看权限控制方式*/
        function FLookAuthorityMode_ValueChanged(source, e) {
//            var a = ASPxClientComboBox.Cast();
//            a.GetSelectedItem().value;
            var ctrlStyle = FLookAuthorityMode.GetSelectedItem().value;
            if (ctrlStyle == "toCls") {
               
            }
            else {
              
            }
        }
        /*通知公告类*/
        function isNotice_CheckedChanged(source, e) {
            if (FIsNotice.GetChecked()) {
                FIsRecObject.SetEnabled(true);
            }
            else {
                FIsRecObject.SetChecked(false);
                FIsRecObject.SetEnabled(false);
            }
        }
        /*图片新闻类*/
        function isPicNews_ValueChanged(s, e) {
            var clientFIsPicNewsObj = ASPxClientCheckBox.Cast(s);
            var clientFPicWidthObj = ASPxClientTextBox.Cast("FPicWidth");
            var clientFPicHeightObj = ASPxClientTextBox.Cast("FPicHeight");
            if (clientFIsPicNewsObj.GetChecked() == true) {
                clientFPicWidthObj.SetEnabled(true);
                clientFPicHeightObj.SetEnabled(true);
                FIsPicWaterMark.SetEnabled(true)
                $("#tbPic").css("display", "block");
            }
            else {

                clientFPicHeightObj.SetText("");
                clientFPicWidthObj.SetText("");
                clientFPicWidthObj.SetEnabled(false);
                clientFPicHeightObj.SetEnabled(false);
                FIsPicWaterMark.SetChecked(false);
                FIsPicWaterMark.SetEnabled(false)
                isPicWaterMark_CheckedChanged(s, e);
                $("#tbPic").css("display", "none");
            }
        }
        /*JCMS推送*/
        function isPubJCMS_CheckedChanged(s, e) {
            if (FIsPubJCMS.GetChecked()) {
                FJCMSColID.SetEnabled(true);
            }
            else {
                FJCMSColID.SetEnabled(false);
                FJCMSColID.SetText("");
            }
        }


        /*专题专栏类*/
        function isSpecialTopic_ValueChanged(s, e) {
            var clientFIsSpecialTopicObj = ASPxClientCheckBox.Cast(s);
            if (clientFIsSpecialTopicObj.GetChecked() == true) {
                $("#tbZTZL").css("display", "block");
            }
            else {
                $("#tbZTZL").css("display", "none");
            }
        }
        /*图片水印*/
        function isPicWaterMark_CheckedChanged(source, e) {
            if (FIsPicWaterMark.GetChecked() == true) {
                FWaterMarkCls.SetEnabled(true);
                FLeftRightMargin.SetEnabled(true);
                FTopBottomMargin.SetEnabled(true);
                $("#tbSYWZ :button").removeAttr("disabled");

            }
            else {
                FWaterMarkCls.SetEnabled(false);
                FWaterMarkCls.SetSelectedIndex(1);
                FLeftRightMargin.SetEnabled(false);
                FTopBottomMargin.SetEnabled(false);
                $('#tbSYWZ :button').attr("disabled", "disabled");
                $('#tbSYWZ :button').removeClass("sywzClass");
                $('#hidWaterMarkPos').val(""); //把保存水印位置隐藏域值设为空
            }
        }
        //图片预览
        function previewImg() {
            var clientlogoUploadObj = ASPxClientUploadControl.Cast("logoUpload");
            if (clientlogoUploadObj.GetText() != "") {
                var ip = new ImagePreview($$("logoUpload_TextBox0_Input"), $$("imgLogo"), {
                });
                ip.img.src = ImagePreview.TRANSPARENT;
                ip.preview();
            }
            else {
                $("#imgLogo").attr("src", "");
            }
            $('#imgLogo').css("height", "100px");
            $('#imgLogo').css("width", "100px");
        }

        /*专题专栏top图片预览*/
        function previewTopImg() {
            var clienttemplTopPicPathUploadObj = ASPxClientUploadControl.Cast("templTopPicPathUpload");
            if (clienttemplTopPicPathUploadObj.GetText() != "") {

                var ip = new ImagePreview($$("templTopPicPathUpload_TextBox0_Input"), $$("imgTemplTopPicPath"), {
                });
                ip.img.src = ImagePreview.TRANSPARENT;
                ip.preview();
            }
            else {
                $("#imgTemplTopPicPath").attr("src", "");
            }
            $('#imgTemplTopPicPath').css("height", "100px");
            $('#imgTemplTopPicPath').css("width", "200px");
        }

        /*点击发起部门
        Manage-维护 Audit-审核 Look-查看
        */
        function chkFQBM_ValueChanged(chkName, cboName) {
            var clientchkFQBMObj = ASPxClientCheckBox.Cast(chkName);
            var clientcboFQBMObj = ASPxClientComboBox.Cast(cboName);
            if (clientchkFQBMObj.GetChecked()) {
                clientcboFQBMObj.SetEnabled(true);
            }
            else {
                clientcboFQBMObj.SetEnabled(false);
            }
        }

        /*权限点击全局
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkQJ_ValueChanged(typeString) {
            var clientchkQJObj = ASPxClientCheckBox.Cast("chk" + typeString + "QJ");
            if (clientchkQJObj.GetChecked()) {
                $("#table" + typeString).css("display", "none");
            }
            else {
                $("#table" + typeString).css("display", "block");
            }
        }

        /*权限指定部门
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkBM_ValueChanged(typeString) {
            var clientchkBMObj = ASPxClientCheckBox.Cast("chk" + typeString + "BM");
            if (clientchkBMObj.GetChecked()) {
                $("#table" + typeString + "BM").css("display", "block");
            }
            else {
                $("#table" + typeString + "BM").css("display", "none");
            }
        }
        /*权限指定工作组
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkGZZ_ValueChanged(typeString) {
            var clientchkGZZObj = ASPxClientCheckBox.Cast("chk" + typeString + "GZZ");
            if (clientchkGZZObj.GetChecked()) {
                $("#table" + typeString + "GZZ").css("display", "block");
            }
            else {
                $("#table" + typeString + "GZZ").css("display", "none");
            }
            resizeTabGroup();
        }
        /*权限指定岗位
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkGW_ValueChanged(typeString) {
            var clientchkGWObj = ASPxClientCheckBox.Cast("chk" + typeString + "GW");
            if (clientchkGWObj.GetChecked()) {
                $("#table" + typeString + "GW").css("display", "block");
            }
            else {
                $("#table" + typeString + "GW").css("display", "none");
            }
            resizeTabGroup();
        }
        /*权限指定用户组
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkYHZ_ValueChanged(typeString) {
            var clientchkYHZObj = ASPxClientCheckBox.Cast("chk" + typeString + "YHZ");
            var clienttxtYHZObj = ASPxClientButtonEdit.Cast("txt" + typeString + "YHZ");
            if (clientchkYHZObj.GetChecked()) {
                clienttxtYHZObj.SetEnabled(true);
            }
            else {
                clienttxtYHZObj.SetEnabled(false);
                clienttxtYHZObj.SetValue("");
                $("#hdSel" + typeString + "GroupKeys").val("");
            }
        }
        /*权限指定人员
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkUser_ValueChanged(typeString) {
            var clientchkUserObj = ASPxClientCheckBox.Cast("chk" + typeString + "User");
            var clienttxtUserObj = ASPxClientButtonEdit.Cast("txt" + typeString + "User");
            if (clientchkUserObj.GetChecked()) {
                clienttxtUserObj.SetEnabled(true);
            }
            else {
                clienttxtUserObj.SetEnabled(false);
                clienttxtUserObj.SetValue("");
                $("#hdSel" + typeString + "UserKeys").val("");
            }
        }
        /*调整TabGroup*/
        function resizeTabGroup() {
            //var clienttabCtlGroupObj = ASPxClientPageControl.Cast("tabCtlGroup");
            //clienttabCtlGroupObj.AdjustSize();
        }

        /*部门删除
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function delDeptRow(tableId, rowId, typeString) {
            $("#" + tableId + " tr").remove("tr[id='" + rowId + "']");
            var treeModelList = JSON.parse($("#hdSel" + typeString + "DeptKeys").val());
            for (var i = 0; i < treeModelList.length; i++) {
                if (rowId == ("tr_" + typeString + "Dept" + treeModelList[i].Value)) {
                    treeModelList.splice(i, 1);
                    break;
                }
            }
            $("#hdSel" + typeString + "DeptKeys").val(JSON.stringify(treeModelList));
        }
        /*工作组删除
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function delWorkGroupRow(tableId, rowId, typeString) {
            $("#" + tableId + " tr").remove("tr[id='" + rowId + "']");
            var treeModelList = JSON.parse($("#hdSel" + typeString + "WorkGroupKeys").val());
            for (var i = 0; i < treeModelList.length; i++) {
                if (rowId == ("tr_" + typeString + "WrokGroup" + treeModelList[i].Value)) {
                    treeModelList.splice(i, 1);
                    break;
                }
            }
            $("#hdSel" + typeString + "WorkGroupKeys").val(JSON.stringify(treeModelList));
        }
        /*岗位删除
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function delPositionRow(tableId, rowId, typeString) {
            $("#" + tableId + " tr").remove("tr[id='" + rowId + "']");
            var treeModelList = JSON.parse($("#hdSel" + typeString + "PositionKeys").val());
            for (var i = 0; i < treeModelList.length; i++) {
                if (rowId == ("tr_" + typeString + "Position" + treeModelList[i].Value)) {
                    treeModelList.splice(i, 1);
                    break;
                }
            }
            $("#hdSel" + typeString + "PositionKeys").val(JSON.stringify(treeModelList));
        }

        /*部门表格增加*/
        function addRowBm_table(typeString) {
            var returnValue = $("#hdSel" + typeString + "DeptKeys").val();
            if (returnValue != "") {
                var tableName = "table" + typeString + "BM";
                var treeModelList = JSON.parse(returnValue);
                for (var i = 0; i < treeModelList.length; i++) {
                    var isExisits = false;
                    $("#" + tableName + " tr").each(function () {
                        if (this.id == ("tr_" + typeString + "Dept" + treeModelList[i].Value)) {
                            isExisits = true;
                            return;
                        }
                    });
                    if (!isExisits) {
                        //添加
                        var rowId = "tr_" + typeString + "Dept" + treeModelList[i].Value;
                        var ddl = treeModelList[i].Text;
                        var ddlJbName = "cbo_" + typeString + "Dept" + treeModelList[i].Value;
                        $("#" + tableName).append("<tr id='" + rowId + "'><td class='tdClass' align='center'><img src='"+rootPath+"/Content/images/delete.gif' width='9' height='9' style='cursor:pointer' onclick=delDeptRow('" + tableName + "','" + rowId + "','" + typeString + "') /></td><td  class='tdClass'  align='center'>" + ddl + "</td><td class='tdClass' align='center'><select id='" + ddlJbName + "' name='" + ddlJbName + "'><option value='1'>正级</option><option value='2'>副级</option><option value='3'>正副级</option><option value='9' selected>任何人</option></select></td></tr>");
                        var propJsonString = $("#hdSel" + typeString + "DeptPropKeys").val();
                        if (propJsonString != "") {
                            var propList = JSON.parse(propJsonString);
                            for (var j = 0; j < propList.length; j++) {
                                if (propList[j].Value == treeModelList[i].Value) {
                                    $("#" + ddlJbName).val(propList[j].Text);
                                    break;
                                }
                            }
                        }
                    }
                }
                var removeTrIdArray = new Array();
                $("#" + tableName + " tr").each(function () {
                    var isExisits = false;
                    for (var i = 0; i < treeModelList.length; i++) {
                        if (this.id == ("tr_" + typeString + "Dept" + treeModelList[i].Value)) {
                            isExisits = true;
                            break;
                        }
                    }
                    if (!isExisits) {
                        removeTrIdArray.push(this.id);
                    }
                });
                for (var i = 0; i < removeTrIdArray.length; i++) {
                    $("#" + tableName + " tr").remove("tr[id='" + removeTrIdArray[i] + "']");
                }
            }

        }

        /*部门增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowBm(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "DeptKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/DeptChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "DeptKeys").val(returnValue);
                addRowBm_table(typeString);
            }
        }

        /*工作组表格增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowGZZ_table(typeString) {
            var returnValue = $("#hdSel" + typeString + "WorkGroupKeys").val();
            if (returnValue != "") {
                var tableName = "table" + typeString + "GZZ";
                var treeModelList = JSON.parse(returnValue);
                for (var i = 0; i < treeModelList.length; i++) {
                    var isExisits = false;
                    $("#" + tableName + " tr").each(function () {
                        if (this.id == ("tr_" + typeString + "WrokGroup" + treeModelList[i].Value)) {
                            isExisits = true;
                            return;
                        }
                    });
                    if (!isExisits) {
                        //添加
                        var rowId = "tr_" + typeString + "WrokGroup" + treeModelList[i].Value;
                        var ddl = treeModelList[i].Text;
                        var ddlJbName = "cbo_" + typeString + "WrokGroup" + treeModelList[i].Value;
                        $("#" + tableName).append("<tr id='" + rowId + "'><td class='tdClass' align='center'><img src='"+rootPath+"/Content/images/delete.gif' width='9' height='9' style='cursor:pointer' onclick=delWorkGroupRow('" + tableName + "','" + rowId + "','" + typeString + "') /></td><td  class='tdClass'  align='center'>" + ddl + "</td><td class='tdClass' align='center'><select id='" + ddlJbName + "' name='" + ddlJbName + "'><option value='1'>正级</option><option value='2'>副级</option><option value='3'>正副级</option><option value='9' selected>任何人</option></select></td></tr>");

                        var propJsonString = $("#hdSel" + typeString + "WorkGroupPropKeys").val();
                        if (propJsonString != "") {
                            var propList = JSON.parse(propJsonString);
                            for (var j = 0; j < propList.length; j++) {
                                if (propList[j].Value == treeModelList[i].Value) {
                                    $("#" + ddlJbName).val(propList[j].Text);
                                    break;
                                }
                            }
                        }
                    }
                }
                var removeTrIdArray = new Array();
                $("#" + tableName + " tr").each(function () {
                    var isExisits = false;
                    for (var i = 0; i < treeModelList.length; i++) {
                        if (this.id == ("tr_" + typeString + "WrokGroup" + treeModelList[i].Value)) {
                            isExisits = true;
                            break;
                        }
                    }
                    if (!isExisits) {
                        removeTrIdArray.push(this.id);
                    }
                });
                for (var i = 0; i < removeTrIdArray.length; i++) {
                    $("#" + tableName + " tr").remove("tr[id='" + removeTrIdArray[i] + "']");
                }
            }
        }
        /*工作组增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowGZZ(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "WorkGroupKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/WorkGroupChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "WorkGroupKeys").val(returnValue);
                addRowGZZ_table(typeString);
            }
        }

        /*岗位表格增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowGW_table(typeString) {
            var returnValue = $("#hdSel" + typeString + "PositionKeys").val();
            if (returnValue != "") {
                var tableName = "table" + typeString + "GW";
                var treeModelList = JSON.parse(returnValue);
                for (var i = 0; i < treeModelList.length; i++) {
                    var isExisits = false;
                    $("#" + tableName + " tr").each(function () {
                        if (this.id == ("tr_" + typeString + "Position" + treeModelList[i].Value)) {
                            isExisits = true;
                            return;
                        }
                    });
                    if (!isExisits) {
                        //添加
                        var rowId = "tr_" + typeString + "Position" + treeModelList[i].Value;
                        var ddl = treeModelList[i].Text;
                        $("#" + tableName).append("<tr id='" + rowId + "'><td class='tdClass' align='center'><img src='"+rootPath+"/Content/images/delete.gif' width='9' height='9' style='cursor:pointer' onclick=delPositionRow('" + tableName + "','" + rowId + "','" + typeString + "') /></td><td  class='tdClass'  align='center'>" + ddl + "</td></tr>");

                    }
                }
                var removeTrIdArray = new Array();
                $("#" + tableName + " tr").each(function () {
                    var isExisits = false;
                    for (var i = 0; i < treeModelList.length; i++) {
                        if (this.id == ("tr_" + typeString + "Position" + treeModelList[i].Value)) {
                            isExisits = true;
                            break;
                        }
                    }
                    if (!isExisits) {
                        removeTrIdArray.push(this.id);
                    }
                });
                for (var i = 0; i < removeTrIdArray.length; i++) {
                    $("#" + tableName + " tr").remove("tr[id='" + removeTrIdArray[i] + "']");
                }
            }
        }
        /*岗位增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowGW(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "PositionKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/PositionChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "PositionKeys").val(returnValue);

                addRowGW_table(typeString);
            }
        }
        /*用户组增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addGroup(typeString) {
            var returnValue = $("#hdSel" + typeString + "GroupKeys").val();
            if (returnValue != "") {
                var treeModelList = JSON.parse(returnValue);
                var clienttxtYHZObj = ASPxClientButtonEdit.Cast("txt" + typeString + "YHZ");
                var yhzString = "";
                for (var i = 0; i < treeModelList.length; i++) {
                    yhzString += treeModelList[i].Text + ",";
                }
                yhzString = yhzString.substr(0, yhzString.lastIndexOf(','));
                clienttxtYHZObj.SetValue(yhzString);
            }
        }
        /*选择用户组
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chooseGroup(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "GroupKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/UserGroupChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "GroupKeys").val(returnValue);
                addGroup(typeString);
            }

        }
        /*用户增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addUser(typeString) {
            var returnValue = $("#hdSel" + typeString + "UserKeys").val();
            if (returnValue != "") {
                var treeModelList = JSON.parse(returnValue);
                var clienttxtUserObj = ASPxClientButtonEdit.Cast("txt" + typeString + "User");
                var userString = "";
                for (var i = 0; i < treeModelList.length; i++) {
                    userString += treeModelList[i].Text + ",";
                }
                userString = userString.substr(0, userString.lastIndexOf(','));
                clienttxtUserObj.SetValue(userString);
            }
        }
        /*选择用户
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chooseUser(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "UserKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/EmpChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "UserKeys").val(returnValue);
                addUser(typeString);
            }

        }
        /*专题专栏模板选择*/
        function clsTemplID_ValueChanged(s, e) {
            var clientFClsTemplIDObj = ASPxClientComboBox.Cast(s);
            $('#imgTemplTopPicPath').removeAttr("style");
            var clienttemplTopPicPathUploadOBj = ASPxClientUploadControl.Cast("templTopPicPathUpload");
            clienttemplTopPicPathUploadOBj.ClearText();
            //            var obj = $('#templTopPicPathUpload_TextBox0_Input').get(0);
            //            var nf = obj.cloneNode(true);
            //            nf.value = '';
            //            obj.parentNode.replaceChild(nf, obj);
            var templID = clientFClsTemplIDObj.GetValue();
            if (templID == "-1") {
            }
            else {
                $.ajax({
                    type: 'POST',
                    url: rootPath + '/Admin/DocumentCls/GetTemplPathAndPicPath',
                    data: { templID: templID },
                    success: function (result) {
                        if (result != "") {
                            var templObj = JSON.parse(result);
                            FDocClsHomepage.SetText(templObj.FTemplShowPath);
                            $('#imgTemplTopPicPath').attr('src', rootPath + templObj["FTemplTopPicPath"]);
                            $('#hidTopPicPath').val(templObj["FTemplTopPicPath"]);

                        }
                    }
                });
            }
        }
        /*保存*/
        function save() {
            var isCtlAllValid = true;
            var errorText = "";
            ASPxClientEdit.ValidateEditorsInContainer(null);
            var clientFDocClsCdObj = ASPxClientTextBox.Cast("FDocClsCd");
            if (!clientFDocClsCdObj.GetIsValid()) {
                isCtlAllValid = false;
                errorText += clientFDocClsCdObj.GetErrorText() + "\n";
            }
            if (isCtlAllValid) {
                lpModal.Show();

                form1.submit();
            }
            else {
                alert(errorText);
            }
        }
    </script>

</head>
@helper  ReturnBoolValue(string value)
    {
        if (value == "Y" || value == "AUDIT")
        {
    @:block
        }
        else
        {
    @:none
        }
}
<body>
    @using (Html.BeginForm("Save", "DocumentCls", FormMethod.Post, new { id = "form1", enctype = "multipart/form-data", @class = "tableFrom" }))
    {
        <div class="floatToolMenu" id="toolMenu" style="z-index: 99;">
            <iframe style="position: absolute; visibility: inherit; top: 0px; left: 0px; width: 100%; height: 28px; z-index: -1; background-color: #00CCFF; border-width: 0px; filter='progid:dximagetransform.microsoft.alpha(style=0,opacity=0)';"></iframe>
            @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
           settings.Items.Add(item =>
           {
               item.Name = "btnSave";
               item.Text = "保存";
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/filesave.png");

           });
           settings.Items.Add(item =>
           {
               item.Name = "btnAddSame";
               item.Text = "增加同级";
               item.ClientEnabled = true;
               item.Visible = ViewData["hdMethod"].ToString() == "EDIT" ? true : false;
               item.Image.Url = Url.Content("~/Content/ControlImages/addSame.png");

           });
           settings.Items.Add(item =>
           {
               item.Name = "btnAddNext";
               item.Text = "增加下级";
               item.ClientEnabled = true;
               item.Visible = ViewData["hdMethod"].ToString() == "EDIT" ? true : false;
               item.Image.Url = Url.Content("~/Content/ControlImages/addNext.png");

           });
           settings.Items.Add(item =>
           {
               item.Name = "btnSeqSameLevel";
               item.Text = "同级栏目排序";
               item.ClientEnabled = true;
               item.Visible = ViewData["hdMethod"].ToString() == "EDIT" ? true : false;
               item.Image.Url = Url.Content("~/Content/ControlImages/move.png");

           });
           settings.Items.Add(item =>
           {
               item.Name = "btnDelete";
               item.Text = "删除";
               item.ItemStyle.ForeColor = System.Drawing.Color.Red;
               item.ClientEnabled = true;
               item.Visible = ViewData["hdMethod"].ToString() == "EDIT" ? true : false;
               item.Image.Url = Url.Content("~/Content/ControlImages/cancel.png");

           });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
        </div>
        <table align="center" class="tableForm">
            <tr>
                <th style="width: 15%">
                    <font color='red'>*</font>@Html.DevExpress().Label(settings => { settings.Text = "信息类别编号:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FDocClsCd";
                   settings.Width = 220;
                   settings.Text = Model.DocClsModel.FDocClsCd;
                   settings.Enabled = String.IsNullOrEmpty(Model.DocClsModel.FDocClsCd) ? true : false;
                   settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'信息类别编号')}";
               }).GetHtml()
                </td>
                <th>
                    @Html.DevExpress().Label(settings => { settings.Text = "上级类别编号:"; }).GetHtml()
                </th>
                <td class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FPreDocClsCd";
                   settings.Width = 220;
                   settings.Text = Model.DocClsModel.FPreDocClsCd;
                   settings.Enabled = false;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    <font color='red'>*</font>@Html.DevExpress().Label(settings => { settings.Text = "信息类别名称:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
               {

                   settings.Name = "FDocClsName";
                   settings.Width = 220;
                   settings.Text = Model.DocClsModel.FDocClsName;
                   settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'信息类别名称')}";
               }).GetHtml()
                </td>
                <th>
                    @Html.DevExpress().Label(settings => { settings.Text = "栏目类型:"; }).GetHtml()
                </th>
                <td align="left" class="tdClass">
                    @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FDocClsProp";

                            settings.Width = 220;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){FDocClsProp_ValueChanged(s,e)}";
                        }).BindList(ViewData["docClsPropSelection"]).Bind(Model.DocClsModel.FDocClsProp).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "编辑模式:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FEditMode";
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.ClientSideEvents.Init = "function(s,e){editMode_ValueChanged(s,e)}";
                            settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){editMode_ValueChanged(s,e)}";
                        }).BindList(new List<SelectListItem>(){new SelectListItem(){ Value="H", Text="HTML"},
                             new SelectListItem(){ Value="O", Text="OFFICE"},
                             new SelectListItem(){ Value="A", Text="均可"}   
                                }).Bind(Model.DocClsModel.FEditMode).GetHtml()
                </td>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "默认编辑模式:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FDefaultEditMode";
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                        }).BindList(new List<SelectListItem>(){new SelectListItem(){ Value="H", Text="HTML"},
                             new SelectListItem(){ Value="O", Text="OFFICE"} 
                                }).Bind(Model.DocClsModel.FDefaultEditMode).GetHtml()
                </td>
            </tr>
            <tr>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsUse";
                        settings.Checked = Model.DocClsModel.FIsUse == 1 ? true : false;
                        settings.Text = "启用";
                    }).GetHtml()
                </td>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FUseSubTitle";
                        settings.Checked = Model.DocClsModel.FUseSubTitle == 1 ? true : false;
                        settings.Text = "需要副标题";
                    }).GetHtml()
                </td>
            </tr>
            <tr>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsHomePageShowLimit";
                        settings.Checked = Model.DocClsModel.FIsHomePageShowLimit == "Y" ? true : false;
                        settings.Text = "首页显示时效控制";
                        settings.Properties.ClientSideEvents.Init = "function(source,e){isHomePageShowLimit_CheckedChanged(source,e)}";
                        settings.Properties.ClientSideEvents.CheckedChanged = "function(source,e){isHomePageShowLimit_CheckedChanged(source,e)}";
                    }).GetHtml()
                </td>
                <th>
                    @Html.DevExpress().Label(settings => { settings.Text = " 首页显示默认天数:"; }).GetHtml()
                </th>
                <td class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FHomePageShowDays";
                   settings.Width = 50;
                   settings.Style.Add("float", "left");
                   settings.Text = Model.DocClsModel.FHomePageShowDays == null ? "" : Model.DocClsModel.FHomePageShowDays.Value.ToString();
                   if (Model.DocClsModel.FIsHomePageShowLimit == "N")
                   {
                       settings.ClientEnabled = false;
                   }
               }).GetHtml()
                    @Html.DevExpress().Label(settings => { settings.Text = "天"; }).GetHtml()
                </td>
            </tr>
            <tr>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsShowHomePageCtrl";
                        settings.Checked = Model.DocClsModel.FIsShowHomePageCtrl == "Y" ? true : false;
                        settings.Text = "信息录入时显示\"是否在首页显示\"控件";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isShowHomePageCtrl_CheckedChanged(s,e)}";
                        settings.Properties.ClientSideEvents.CheckedChanged = "function(s,e){isShowHomePageCtrl_CheckedChanged(s,e)}";
                    }).GetHtml()
                </td>
                <th>
                    @Html.DevExpress().Label(settings => { settings.Text = " 显示默认值:"; }).GetHtml()
                </th>
                <td class="tdClass">
                    @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FDefaultShowValue";

                            settings.Width = 150;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                        }).BindList(ViewData["defaultShowValueSelection"]).Bind(Model.DocClsModel.FDefaultShowValue).GetHtml()
                </td>
            </tr>
            <tr>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsCtrlLookAuthority";
                        settings.Checked = Model.DocClsModel.FIsCtrlLookAuthority == "Y" ? true : false;
                        settings.Text = "控制查看权限";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isCtrlLookAuthority_Init(s,e)}";
                        settings.Properties.ClientSideEvents.CheckedChanged = "function(s,e){isCtrlLookAuthority_CheckedChanged(s,e)}";
                    }).GetHtml()
                </td>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsPublicTitle";
                        settings.Checked = Model.DocClsModel.FIsPublicTitle == "Y" ? true : false;
                        settings.Text = "公开标题";
                    }).GetHtml()
                </td>
            </tr>
            <tr>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
                <th>
                    @Html.DevExpress().Label(setting => { setting.Text = "查看权限控制方式:"; }).GetHtml()
                </th>
                <td class="tdClass">
                    @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FLookAuthorityMode";
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){FLookAuthorityMode_ValueChanged(s,e)}";
                        }).BindList(new List<SelectListItem> { 
                            new SelectListItem(){Value="A",Text="控制到栏目"},
                            new SelectListItem(){Value="D",Text="控制到信息"}}).Bind(Model.DocClsModel.FLookAuthorityMode).GetHtml()
                </td>
            </tr>
            <tr>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsNeedAudit";
                        settings.Checked = Model.DocClsModel.FIsNeedAudit == "Y" ? true : false;
                        settings.Text = "信息需要审核";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isNeedAudit_CheckedChanged(s,e)}";
                        settings.Properties.ClientSideEvents.CheckedChanged = "function(s,e){isNeedAudit_CheckedChanged(s,e)}";
                    }).GetHtml()
                </td>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsReferenceNo";
                        settings.Checked = Model.DocClsModel.FIsReferenceNo == "Y" ? true : false;
                        settings.Text = "录入时需输入文号";
                    }).GetHtml()
                </td>
            </tr>
            <tr  style="display: none" >
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsNotice";
                        settings.Checked = Model.DocClsModel.FIsNotice == "Y" ? true : false;
                        settings.Text = "通知公告类";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isNotice_CheckedChanged(s,e)}";
                        settings.Properties.ClientSideEvents.CheckedChanged = "function(s,e){isNotice_CheckedChanged(s,e)}";

                    }).GetHtml()
                </td>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsRecObject";
                        settings.Checked = Model.DocClsModel.FIsRecObject == "Y" ? true : false;
                        settings.Text = "通知是否指定接收对象";
                    }).GetHtml()
                </td>
            </tr>
            <tr style="display: none">
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsPubJCMS";
                        settings.Checked = Model.DocClsModel.FIsPubJCMS == "Y" ? true : false;
                        settings.Text = "允许推送至JCMS";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isPubJCMS_CheckedChanged(s,e)}";
                        settings.Properties.ClientSideEvents.CheckedChanged = "function(s,e){isPubJCMS_CheckedChanged(s,e)}";
                    }).GetHtml()
                </td>
                <th>
                    @Html.DevExpress().Label(settings => { settings.Text = "JCMS对应栏目:"; }).GetHtml()
                </th>
                <td class="tdClass">
                         @Html.DevExpress().TextBox(settings =>
                    {
                        settings.Name = "FJCMSColID";
                        settings.Width = 100;
                        settings.Text = Model.DocClsModel.FJCMSColID.HasValue ? Model.DocClsModel.FJCMSColID.ToString() : "";
                        settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyAndNumericValidation(s,e,'JCMS对应栏目')}";
                    }).GetHtml()
                       
                </td>
            </tr>
            <tr>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsImport";
                        settings.Checked = Model.DocClsModel.FIsImport == "Y" ? true : false;
                        settings.Text = "允许批量引入";
                        settings.ClientVisible = false;
                    }).GetHtml()
                    &nbsp;
                </td>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsExamine";
                        settings.Checked = Model.DocClsModel.FIsExamine == "Y" ? true : false;
                        settings.Text = "需要批示";
                    }).GetHtml()
                </td>
            </tr>
            <tr style="display:none">
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsManuscript";
                        settings.Checked = Model.DocClsModel.FIsManuscript == "Y" ? true : false;
                        settings.Text = "统计投录文章 ";
                    }).GetHtml()
                </td>
                <th>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </th>
                <td class="tdClass">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsVote";
                        settings.Checked = Model.DocClsModel.FIsVote == "Y" ? true : false;
                        settings.Text = "参与投票 ";
                    }).GetHtml()
                </td>
            </tr>
        </table>
        
        <fieldset>
            <legend style="font-size: 12px">
                @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsPicNews";
                        settings.Checked = Model.DocClsModel.FIsPicNews == 1 ? true : false;
                        settings.Text = "图片新闻类";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isPicNews_ValueChanged(s,e)}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){isPicNews_ValueChanged(s,e)}";
                    }).GetHtml()
            </legend>
            <table class="tableForm" id="tbPic" style="display: none">
                <tr>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "缩略图宽度:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass">
                        @Html.DevExpress().TextBox(settings =>
                   {
                       settings.Name = "FPicWidth";
                       settings.Width = 100;
                       settings.Text = Model.DocClsModel.FPicWidth != 0 ? Model.DocClsModel.FPicWidth.ToString() : "";
                       settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyAndNumericValidation(s,e,'缩略图宽度')}";

                   }).GetHtml()
                    </td>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "缩略图高度:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass">
                        @Html.DevExpress().TextBox(settings =>
                   {
                       settings.Name = "FPicHeight";
                       settings.Width = 100;
                       settings.Text = Model.DocClsModel.FPicHeight != 0 ? Model.DocClsModel.FPicHeight.ToString() : "";
                       settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyAndNumericValidation(s,e,'缩略图高度')}";
                   }).GetHtml()
                    </td>
                </tr>
                <tr>
                    <th>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </th>
                    <td class="tdClass">
                        @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsPicWaterMark";
                        settings.Checked = Model.DocClsModel.FIsPicWaterMark == 1 ? true : false;
                        settings.Text = "图片加水印";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isPicWaterMark_CheckedChanged(s,e)}";
                        settings.Properties.ClientSideEvents.CheckedChanged = "function(s,e){isPicWaterMark_CheckedChanged(s,e)}";

                    }).GetHtml()
                    </td>
                    <th>
                        @Html.DevExpress().Label(settings => { settings.Text = "水印类型:"; }).GetHtml()
                    </th>
                    <td class="tdClass">
                        @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FWaterMarkCls";
                            settings.Width = 150;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                        }).BindList(ViewData["waterTypePropSelection"]).Bind(Model.DocClsModel.FWaterMarkCls).GetHtml()
                    </td>
                </tr>
                <tr>
                    <th width="15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "水印显示位置:"; }).GetHtml()
                    </th>
                    <td width="35%" align="left" class="td_control" colspan="3">
                        <table border="0" cellpadding="0" cellspacing="0" id="tbSYWZ">
                            <tr height="30px">
                                <td class="tdNoBorder">
                                    <input type="button" id="water1" style="height: 30px; width: 30px" value="↖" /></td>
                                <td class="tdNoBorder">
                                    <input type="button" id="water2" style="height: 30px; width: 30px" value="↑" /></td>
                                <td class="tdNoBorder">
                                    <input type="button" id="water3" style="height: 30px; width: 30px" value="↗" /></td>
                            </tr>
                            <tr height="30px">
                                <td class="tdNoBorder">
                                    <input type="button" id="water4" style="height: 30px; width: 30px" value="←" /></td>
                                <td class="tdNoBorder">
                                    <input type="button" id="water5" style="height: 30px; width: 30px" value="○" /></td>
                                <td class="tdNoBorder">
                                    <input type="button" id="water6" style="height: 30px; width: 30px" value="→" /></td>
                            </tr>
                            <tr height="30px">
                                <td class="tdNoBorder">
                                    <input type="button" id="water7" style="height: 30px; width: 30px" value="↙" /></td>
                                <td class="tdNoBorder">
                                    <input type="button" id="water8" style="height: 30px; width: 30px" value="↓" /></td>
                                <td class="tdNoBorder">
                                    <input type="button" id="water9" style="height: 30px; width: 30px" value="↘" /></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "水印左右边距值:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass">
                        @Html.DevExpress().TextBox(settings =>
                   {
                       settings.Name = "FLeftRightMargin";
                       settings.Width = 100;
                       settings.Text = Model.DocClsModel.FLeftRightMargin != 0 ? Model.DocClsModel.FLeftRightMargin.ToString() : "";
                       settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyAndNumericValidation(s,e,'水印左右边距值')}";

                   }).GetHtml()
                    </td>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "水印上下边距值:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass">
                        @Html.DevExpress().TextBox(settings =>
                   {
                       settings.Name = "FTopBottomMargin";
                       settings.Width = 100;
                       settings.Text = Model.DocClsModel.FTopBottomMargin != 0 ? Model.DocClsModel.FTopBottomMargin.ToString() : "";
                       settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyAndNumericValidation(s,e,'水印上下边距值')}";
                   }).GetHtml()
                    </td>
                </tr>
            </table>
        </fieldset>
        <fieldset>
            <legend style="font-size: 12px">
                @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsSpecialTopic";
                        settings.Checked = Model.DocClsModel.FIsSpecialTopic == "Y" ? true : false;
                        settings.Text = "专题专栏类";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isSpecialTopic_ValueChanged(s,e)}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){isSpecialTopic_ValueChanged(s,e)}";
                    }).GetHtml()
            </legend>
            <table class="tableForm" id="tbZTZL" style="display: none">
                <tr>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "栏目LOGO:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass">
                        @Html.DevExpress().UploadControl(
                            settings =>
                            {
                                settings.Name = "logoUpload";
                                settings.BrowseButton.Text = "浏览";
                                settings.ClearFileSelectionImage.ToolTip = "清除选择";
                                settings.ShowProgressPanel = false;
                                settings.ValidationSettings.Assign(ElingOA6_Admin_DSJCJ.Common.UploadControlHelper.PicValidationSettings);
                                settings.ShowUploadButton = false;
                                settings.ClientSideEvents.TextChanged = "function(s,e){previewImg()}";
                            }).GetHtml()
                    </td>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "LOGO预览:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass">
                        <img id="imgLogo" src="@Model.DocClsModel.FLogoNewFileName" />
                    </td>
                </tr>
                <tr>
                    <th>
                        @Html.DevExpress().Label(settings => { settings.Text = "栏目模版:"; }).GetHtml()
                    </th>
                    <td class="tdClass">
                        @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FClsTemplID";
                            settings.Width = 150;
                            settings.Properties.TextField = "FTemplName";
                            settings.Properties.ValueField = "FClsTemplID";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){clsTemplID_ValueChanged(s,e)}";
                        }).BindList(ViewData["clsTemplList"]).Bind(Model.DocClsModel.FClsTemplID.Value.ToString()).GetHtml()
                    </td>
                    <th>
                    </th>
                    <td>
                    </td>
                </tr>
                <tr>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "栏目首页显示URL:"; }).GetHtml()
                    </th>
                    <td style="width: 85%" class="tdClass" colspan="3">
                        @Html.DevExpress().TextBox(settings =>
                   {
                       settings.Name = "FDocClsHomepage";
                       settings.Width = System.Web.UI.WebControls.Unit.Percentage(98);
                       settings.Text = Model.DocClsModel.FDocClsHomepage;

                   }).GetHtml()
                    </td>
                </tr>
                <tr>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "栏目顶部显示图片:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass">
                        @Html.DevExpress().UploadControl(
                            settings =>
                            {
                                settings.Name = "templTopPicPathUpload";
                                settings.BrowseButton.Text = "浏览";
                                settings.ClearFileSelectionImage.ToolTip = "清除选择";
                                settings.ShowProgressPanel = false;
                                settings.ValidationSettings.Assign(ElingOA6_Admin_DSJCJ.Common.UploadControlHelper.PicValidationSettings);
                                settings.ShowUploadButton = false;
                                settings.ClientSideEvents.TextChanged = "function(s,e){previewTopImg()}";
                            }).GetHtml()
                    </td>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "预览:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass">
                        <img id="imgTemplTopPicPath" src="@Model.DocClsModel.FTemplTopPicPath" />
                    </td>
                </tr>
            </table>
        </fieldset>
@*@Html.DevExpress().PageControl(
    settings =>
    {
        settings.Name = "tabCtlGroup";
        settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
        settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
        settings.Styles.Content.Border.BorderWidth = 0;
        //settings.ClientVisible = false;
        settings.TabPages.Add("发布权限").SetContent(() =>
        {
            Html.RenderPartial("DocumentPubPartial");
        });
        settings.TabPages.Add("维护权限").SetContent(() =>
        {
            Html.RenderPartial("DocumentManagePartial");
        });
        settings.TabPages.Add("审核权限").SetContent(() =>
        {
            Html.RenderPartial("DocumentAuditPartial");
        });
        settings.TabPages.Add("查看权限").SetContent(() =>
        {
            Html.RenderPartial("DocumentLookPartial");
        });
        settings.TabPages[2].ClientEnabled = false;
        settings.TabPages[3].ClientEnabled = false;
        // settings.TabPages[2].ClientVisible = false;
        //settings.TabPages[3].ClientVisible = false;
    }).GetHtml()*@
        <div id="tabs" class="div" style="display: none">
            <ul>
                <li><a href="#PubTab">发布权限</a></li>
                <li><a href="#ManageTab">维护权限</a></li>
                <li id="liAuditTab" style="display: none"><a href="#AuditTab">审核权限</a></li>
                <li id="liLookTab" style="display: none"><a href="#LookTab">查看权限</a></li>
            </ul>
            <div id="PubTab">
                @Html.Partial("DocumentPubPartial")
            </div>
            <div id="ManageTab">
                @Html.Partial("DocumentManagePartial")
            </div>
            <div id="AuditTab">
                @Html.Partial("DocumentAuditPartial")
            </div>
            <div id="LookTab">
                @Html.Partial("DocumentLookPartial")
            </div>
        </div>
        
        
@* @Html.Partial("DocumentPubPartial");
         @Html.Partial("DocumentManagePartial");
         @Html.Partial("DocumentAuditPartial");
         @Html.Partial("DocumentLookPartial");*@
        @Html.Hidden("hdjsAlert", ViewData["jsAlert"]);//错误信息
        @Html.Hidden("hdMethod", ViewData["hdMethod"]);                                              
        @Html.Hidden("hidWaterMarkPos", Model.DocClsModel.FWaterMarkPos);//保存水印位置
        @Html.Hidden("hidTopPicPath", "");//保存专题专栏栏目首页显示图片路径
        @Html.Hidden("FLogoNewFileName", Model.DocClsModel.FLogoNewFileName);                                 
        @Html.Hidden("FTemplTopPicPath", Model.DocClsModel.FTemplTopPicPath); 
        @Html.Hidden("hdDocClsProp", Model.DocClsModel.FDocClsProp);//原栏目类型
                                                                                                                                                                                 
        @Html.Partial("DocumentHiddenDeptPartial")
        @Html.Partial("DocumentHiddenWorkGroupPartial")
        @Html.Partial("DocumentHiddenPositionPartial")
        @Html.Partial("DocumentHiddenGroupPartial")
        @Html.Partial("DocumentHiddenUserPartial")
    }
</body>
</html>
